<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>View All Orders</title>
</head>
<body>
	<h1 align="center">All orders</h1>
	<br />
	<br />
	<c:if test="${empty allOrders}">
		<p>No information.</p>
	</c:if>

	<c:set var="colorqwerty" scope="session" value="${ADFF2F}" />

	<c:if test="${not empty allOrders}">
		<table align="center" border="1" cellpadding="10" cellspacing="0">
			<tr BGCOLOR=FFC0CB>
				<th>Title of the book</th>
				<th>Client</th>
				<th>Order date</th>
				<th>Delivery address</th>
				<th>Count</th>
				<th>Total price</th>
				<th>Order status</th>
			</tr>

			<c:forEach items="${allOrders}" var="order">
				<tr>
					<td>${order.book.name}</td>
					<td>${order.buyer.surname}</td>
					<td>${order.date}</td>
					<td>${order.address}</td>
					<td>${order.count}</td>
					<td>${order.book.purchasePrice*order.count}</td>
					<td><c:if test="${order.status==1}">NEW</c:if> <c:if
							test="${order.status==0}">SUCCESFULL</c:if> <c:if
							test="${order.status==-1}">PARTLY</c:if><c:if
							test="${order.status==-2}">SENT TO THE PUBLISHER</c:if></td>
				</tr>
			</c:forEach>
		</table>
	</c:if>

</body>
</html>